<?php
/**
 * lemocms
 * ============================================================================
 * 版权所有 2018-2027 lemocms，并保留所有权利。
 * 网站地址: https://www.lemocms.com
 * ----------------------------------------------------------------------------
 * 采用最新Thinkphp6实现
 * ============================================================================
 * Author: yuege
 * Date: 2019/8/2
 */
namespace app\index\controller;
use app\common\library\Sms as Smslib;
use think\facade\View;
use think\facade\Cache;
class Index extends \app\BaseController{

    public function index(){
		abort(404, '页面不存在');
        // return view();
    }
	public function send(){
		$mobile = '15511329132';
		$data['prod_code'] = '11111';
		// halt($data);
		Smslib::send((string)$mobile, $data['prod_code'], 11, 'follow');
	}
	public function testRedis(){
		$redis = Cache::store('redis')->handler(); // 这条代码等于  $redis = new \Redis();
		
		$redis->set("info",'hello world');   // 设置字段
		$redis->expire("info",10);  // 设置过期时间
		$result = $redis->get("info");
		// $redis->set("info",0.1,10);
		// $result = $redis->get("info");
		// Cache::store('redis')->set('info', 0.1, 10);
		// $result = (float)Cache::store('redis')->get("info");
		// if($result > 0){
		// 	echo 1;
		// }else{
		// 	echo 2;
		// }
		var_dump($result); //1 没过期，2 为过期；
	}
}